#ifndef __SN_STRING_H__
#define __SN_STRING_H__

#include <string.h>
#include <sys/types.h>

typedef struct {
	size_t      len;
	u_char     *data;
} sn_str_t;

#define sn_string(str)      { sizeof(str) - 1, (u_char *) str }
#define sn_null_string      { 0, NULL }
#define sn_str_null(str)    (str)->len = 0; (str)->data = NULL
#define sn_str_set(str, text)                                   \
	(str)->len = strlen(text) ; (str)->data = (u_char *) text

u_char *sn_ltrim_mptr_str(u_char *p, u_char *trim);
void sn_note_mchar_str(u_char *p, char note);
size_t sn_str_cmp(const void *src, int src_len, const void *dest, int dest_len);
u_char *sn_rfind_first_str(u_char *p, u_char c);
u_char *sn_rfind_first_mptr_str(u_char *p, u_char c);
size_t sn_lfind_last_cursor_str(u_char *p, u_char c);
#endif
